package com.enjoy;

import java.util.function.Consumer;

public class Test2 {

    // 1.消费型接口
    public void shopping(double money, Consumer<Double> consumer) {
        consumer.accept(money);

    }

    public static void main(String[] args) {
        Test2 test2 = new Test2();
        test2.shopping(500, (money) -> System.out.println("买了一个汉堡" + money));
    }
}
